##
##  $Header: /pub/cvsroot/mydns/pkg/Makefile.am,v 1.8 2003/03/05 07:06:24 bboy Exp $
##

EXTRA_DIST	=	README mydns-mysql.spec.in mydns-postgres.spec.in
SEDFILE 		=	../version.sed

sedvars:
	if ! `test -f $(SEDFILE)`; then make -C .. sedfile; fi

spec: sedvars mydns-mysql.spec.in mydns-postgres.spec.in
	sed -f $(SEDFILE) mydns-mysql.spec.in > mydns-mysql.spec
	sed -f $(SEDFILE) mydns-postgres.spec.in > mydns-postgres.spec

clean:
	rm -f core core* *~ mydns-mysql.spec mydns-postgres.spec

release: rpm

rpm: spec
	@if ! `test -f ../mydns-@PACKAGE_VERSION@.tar.gz`; then make -C .. dist; fi
	for db in mysql postgres; do \
	  tar xzf ../mydns-@VERSION@.tar.gz; \
	  mv mydns-@VERSION@ mydns-$$db-@VERSION@; \
	  tar czf /usr/src/redhat/SOURCES/mydns-$$db-@VERSION@.tar.gz mydns-$$db-@VERSION@; \
	  rm -rf mydns-$$db-@VERSION@; \
	  cp -f mydns-$$db.spec /usr/src/redhat/SPECS; \
	  rpm -ba /usr/src/redhat/SPECS/mydns-$$db.spec; \
	  cp -f /usr/src/redhat/RPMS/i386/mydns-$$db-@PACKAGE_VERSION@-*.rpm $(top_srcdir); \
	done

## vi:set ts=3:
